package MyGO.Form;

import MyGO.utils.DateTimeUtils.DateTimeUtils;
import javafx.collections.ObservableArray;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

import static MyGO.utils.DateTimeUtils.getTime.getDateTime;

@Data
@AllArgsConstructor
public class TrackForm {
    public static Integer count = 0;
    private String id;
    private PatientInfoForm patientInfoForm;
    private RegistForm registForm;
    private CheckForm checkForm;
    private MedicineForm medicineForm;
    private String creatTime;
    private String finishTime;
    private String status_main;   // 维护目前处于什么状态，挂号，医生接诊，待收费， 检查；
    private String status_vail;    // 维护药房的状态
    private String diagnoseResult;
    private String advice;
    private Boolean finish;
    private Double fee = 0.0;

    public TrackForm() {
        count++;
        this.id = String.valueOf(count);
        patientInfoForm = new PatientInfoForm();
        registForm = new RegistForm();
        checkForm = new CheckForm();
        medicineForm = new MedicineForm();
        checkForm.setId(this.id);
        patientInfoForm.setId(this.id);
        registForm.setId(this.id);
        medicineForm.setId(this.id);
        this.status_main = "未挂号";
        this.status_vail = "未开药";
        this.creatTime = getDateTime();
        finish = false;
    }

    public void finish() {
        LocalDateTime localDateTime = LocalDateTime.now();
        this.finishTime = DateTimeUtils.formatLocalDateTime(localDateTime);
        finish = true;
    }
    public String getName() {
        return patientInfoForm.getName();
    }
}
